﻿using System;

namespace eight
{
    internal class Program
    {
        static void Main(string[] args)
        {
           
                Console.WriteLine("1000以内的完数有：");

                for (int num = 1; num <= 1000; num++)
                {
                    int sum = 0;

                   
                    for (int i = 1; i < num; i++)
                    {
                        if (num % i == 0)
                        {
                            sum += i;
                        }
                    }

                    if (sum == num)
                    {
                        Console.Write(num+" ");
                    }

                }
                Console.WriteLine();
            }
        }
    
    
}
